/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/


package org.jfab.core.analyzer;

import org.jfab.core.model.CGObject;

import java.util.List;


/**
 * Defines methods required by an analyzer of Java code.
 *
 * @param  <T>  Return type.
 * @param  <U>  Source type.
 */
public interface Analyzer<T extends CGObject, U>
{
    /**
     * Analyze the given object and return the result.
     *
     * @param   object      Source object.
     * @param   javaSource  Java source code.
     *
     * @return  a new CGObject.
     */
    T analyze(U object, String javaSource);

    /**
     * @param   objects     Objects.
     * @param   javaSource  Java source.
     *
     * @return  a new list of code generator fields.
     */
    List<T> analyze(U[] objects, String javaSource);
}
